package com.cn.wangxin;

import com.google.common.util.concurrent.RateLimiter;

import java.util.concurrent.TimeUnit;

/**
 * 功能描述 TODO
 *
 * @Created Time 2016/10/20
 * @Edited Time 2016/10/20
 * @Created by wangxin43
 */
public class MyRatelimiter {
    private RateLimiter rateLimiter;
    private int limiter;
    private int ti;
    public void init(){
        this.rateLimiter = RateLimiter.create(limiter,ti, TimeUnit.MILLISECONDS);
    }

    public void setLimiter(int limiter) {
        this.limiter = limiter;
    }

    public void setTi(int ti) {
        this.ti = ti;
    }

    public RateLimiter getRateLimiter() {
        return rateLimiter;
    }
}
